<%--
  Created by Eduard Boiko
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>

<spring:message code="create-game.gameNameLabel" var="gameNameLabel"/>
<spring:message code="create-game.ownerNameLabel" var="ownerNameLabel"/>
<spring:message code="create-game.numberOfCardsLabel"
                var="numberOfCardsLabel"/>
<spring:message code="create-game.botTypeLabel" var="botTypeLabel"/>
<spring:message code="create-game.createButton" var="createButton"/>

<html>
<head>
    <title>Create Game</title>

    <link
            href="${pageContext.servletContext.contextPath}/resources/css/bootstrap.min.css"
            rel="stylesheet">

</head>
<body>

<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse"
                    data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span> <span
                    class="icon-bar"></span> <span class="icon-bar"></span> <span
                    class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href='<spring:url value="/" htmlEscape="true"/>'>
                Kaiji
            </a>
        </div>

        <ul class="nav navbar-nav navbar-right">
            <li><a href="?lang=en">en</a></li>
            <li><a href="?lang=ru">ru</a></li>
        </ul>
    </div>
</div>

<br> <br> <br>

<div class="container">

    <div class="row">
        <center>

            <spring:url value="/game/new" var="url"/>
            <form:form action="${url}" method="POST" modelAttribute="gameInfo">
                <table>
                    <tr>
                        <td>
                            <div style="display:inline-block;width:150px">${gameNameLabel}</div>
                        </td>
                        <td><form:input path="gameName" size="25"/>
                        <td><form:errors path="gameName"/></td>
                    </tr>


                    <tr>
                        <td>
                            <div style="display:inline-block;width:150px">${ownerNameLabel}</div>
                        </td>
                        <td><form:input path="playerName" size="25"/></td>
                        <td>
                                <form:errors path="playerName"/>
                        <td/>
                    </tr>

                    <tr>
                        <td>
                            <div style="display:inline-block;width:150px">${numberOfCardsLabel}</div>
                        </td>
                        <td><form:input path="numberOfCards" size="25"/></td>
                        <td><form:errors path="numberOfCards"/></td>
                    </tr>


                    <tr>
                        <td>
                            <div style="display:inline-block;width:150px">${botTypeLabel}</div>
                        </td>
                        <td>
                            <form:select path="botType">
                                <form:option value="EASY" label="Easy Bot"/>
                                <form:option value="MEDIUM" label="Medium Bot"/>
                                <form:option value="HARD" label="Hard Bot"/>
                            </form:select>
                        <td>
                    </tr>

                </table>

                <form:button>${createButton}</form:button>

            </form:form>

        </center>
    </div>

</div>

</body>
</html>
